home *** CD-ROM | disk | FTP | other *** search
/ 95.86.62.111 / 95.86.62.111.tar / 95.86.62.111 / Active Sync 4.5.rar / Active Sync 4.5 / setup.msi / ActiveSync.cab / activesync.chm.48F17E76_FD07_4BE3_97CE_1B27523FD30B / scripts / dtuelink.js < prev    next >
Text File  |  2006-10-01  |  2KB  |  70 lines

  1. // version 9324
  2. // links to HxLink.css, DTUE CSS, and DTUE topics scripts
  3.  
  4. var ieVer = getIEVersion();
  5. var jsPath = scriptPath();
  6.  
  7. writeCSS(jsPath);
  8.  
  9. function getIEVersion() {
  10. //determines the IE version. Returns 0 if not IE
  11.     var verNum = 0
  12.     if (navigator.appName == "Microsoft Internet Explorer") {
  13.         var sVer = window.navigator.userAgent
  14.         var msie = sVer.indexOf ( "MSIE " )
  15.         if ( msie > 0 ) {    // browser is Microsoft Internet Explorer; return version number
  16.             verNum = parseFloat( sVer.substring ( msie+5, sVer.indexOf ( ";", msie ) ) );
  17.         }
  18.     }
  19.     return verNum;
  20. }
  21.  
  22. function scriptPath() { 
  23. //Determine path to JS-the CSS is in the same directory as the script
  24.     if ( ieVer >= 4 ) {
  25.         var spath = document.scripts[document.scripts.length - 1].src;
  26.         spath = spath.toLowerCase();
  27.         return spath.replace("dtuelink.js", "");
  28.         }
  29.     else {
  30.         var spath = "..\\scripts\\"; //defaults to a scripts folder
  31.         return spath;
  32.     }
  33. }
  34.  
  35. function writeCSS(spath) {
  36.     var dtueCSS = "";
  37.     var HxLinkPath = "";
  38.     var HxLink = "";
  39.     // Get a CSS name based on the browser.
  40.     if ( ieVer >= 5) {
  41.         dtueCSS = "DTUE.css";
  42.         HxLink = "HxLink.css";
  43.         HxLinkPath = "ms-help://Hx/HxRuntime/";
  44.         document.writeln('<SCRIPT SRC="' + spath + '\dtue_ie5.js"></SCRIPT>');
  45.         document.writeln('<SCRIPT FOR="reftip" EVENT="onclick">window.event.cancelBubble = true;</SCRIPT>');
  46.         document.writeln('<SCRIPT FOR="cmd_lang" EVENT="onclick">langClick(this);</SCRIPT>');
  47.         document.writeln('<SCRIPT FOR="cmd_filter" EVENT=onclick>filterClick(this);</SCRIPT>');
  48.         }
  49.     else {
  50.         if (ieVer >=4 && ieVer <5) {
  51.             document.writeln('<SCRIPT SRC="' + spath + '\dtue_ie4.js"></SCRIPT>');
  52.             dtueCSS = "msdn_ie4.css";
  53.             HxLink = "";
  54.             HxLinkPath = "";
  55.             }
  56.         else {
  57.             if (ieVer < 4) 
  58.                 document.writeln('<SCRIPT SRC="' + spath + '\dtue_ie3.js"></SCRIPT>');
  59.                 dtueCSS = "msdn_ie3.css";
  60.                 HxLink = "";
  61.                 HxLinkPath = "";
  62.                 //document.write ("<link disabled rel='stylesheet' href='"+ spath + dtueCSS + "'>")
  63.                 //document.write ("<style>@import url("+ spath + dtueCSS + ");</style>")
  64.             }
  65.         }
  66.     // Insert CSS calls
  67.     document.writeln('<LINK REL="stylesheet" HREF="' + HxLinkPath + HxLink + '">');
  68.     document.writeln('<LINK REL="stylesheet" HREF="' + spath + dtueCSS + '">');
  69. }
  70.